﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FinanceGoldPointDal.DAL;
using FinanceGoldPointDal.DTO.Filters;

namespace FinanceGoldPointDal.Utils
{
  public class MonitorQuotes : baseDAL
  {
    SymbolsGetter _getterLev1 = new SymbolsGetter();

    public bool BloaccaMonitoraggio { get; set; }

    List<DTO.BaseQuoteData> _listTemp = null;
    string[] arrTmp = new string[5];

    public void startMonitoraggio()
    {

      var arrSim = GetSimboliBase(new QuoteFilter()).ToArray();

      do
      {
        for (int conta = 5; conta < arrSim.Length; conta += 5)
        {

          arrTmp[0] = arrSim[conta-1].Code.TrimEnd(); 
          arrTmp[1] = arrSim[conta-1].Code.TrimEnd(); 
          arrTmp[2] = arrSim[conta-1].Code.TrimEnd(); 
          arrTmp[3] = arrSim[conta-1].Code.TrimEnd(); 
          arrTmp[4] = arrSim[conta-1].Code.TrimEnd(); 


          _listTemp = _getterLev1.GetQuotes(arrTmp, 1);


          foreach (var item in _listTemp)
          {
            if (item.ChangeSegnal.Equals("+"))
            { //comtrollo !!!!!


            }
          }


        }

      } while (!BloaccaMonitoraggio);


    }


  }
}
